

let date = new Date()

var month = date.getMonth()
var year = date.getFullYear()
console.log(`${year}-${month}`)

console.log(typeof(date))



console.log(date)


var strTime = '2024-12'
var dateformate = new Date(Date.parse(strTime))
console.log(dateformate)
console.log(dateformate - date)



/***
 * 数据库存入的是   d年-d月
 *         
 *      用户输入的是     u年-u月
 *      判断:
 *          本月的4号，到下个月的3号  -->周期时间
 *         
 *          
 * 
 * 
 * 
 * 
 * 
 */
var errDate = Math.abs(11 + 2) % 12
console.log(errDate)
/***
 * 12 = >10
 * 11 = >9
 * 10 = >8
 * 9  = >7
 * 8     6
 * 7     5
 * 6     4
 * 5     3
 * 4     2
 * 3     1
 * 2     12
 * 1     11
 */

console.log(new Date())

console.log('---------------------------------------')

const fun = async function(){
    for(var i=0;i<1000;i++){

    }
    console.log("fun-------------")
    return 'hello'
}

const res = fun()
res.then(value=>{
    console.log(value)
})


console.log("fun after-----")

console.log(`res :=> ${res}`)

